<script setup>
import { useRouter } from 'vue-router';
import treeMenu from './treeMenu.vue';
import { useStore } from '../store/store'

const store = useStore()

// const menuData = reactive(router.options.routes[0].children)
const menuData = store.routerList


function handleOpen(key, keyPath) {
  // console.log(key, keyPath)
}

function handleClose(key, keyPath) {
  // console.log(key, keyPath)
}
</script>

<template>
  <el-menu
    :style="{
      width: store.asideIshow ? '230px' : '64px'

    }"
    :collapse="!store.asideIshow"
    active-text-color="#409eff"
    background-color="#545c64"
    text-color="#fff"
    class="asied-container"
    @open="handleOpen"
    @close="handleClose"
    :default-active="store.menuActive"
  >
    <h3 class="logo-lg">{{ !store.asideIshow ? '虎虎' : '虎虎陪诊'}}</h3>

    <treeMenu :index="'1'" :menu-data="menuData"></treeMenu>
  </el-menu>
</template>

<style scoped lang="less">
.asied-container {
  height: 100%;
  .logo-lg {
    font-size: 20px;
    text-align: center;
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
}
</style>
